﻿#include<iostream>
#include"Adjacency_list.h"
#include"Adjacency_matrix.h"
using namespace std;
int main()
{
    char a[10] = "abcde";
    ALGraph g(a, 5, 7);
    cout << "你输入的图的邻接表是:" << '\n';
    g.ALGraphOut();
    cout << "深度优先遍历顺序:" << '\n';
    g.DFSTraverse(2);//2是遍历起始点的编号,也可以从其他点遍历
    g.BFSTraverse(1);
    cout << '\n';

    cout << "输入边两端顶点编号(如输入边(a,b)时应输入: 0 1 回车):" << '\n';
    MGraph s(a, 5, 7);
    cout << "你输入的图的邻接矩阵是:" << '\n';
    s.MGraphOut();
    s.prim(2);
    cout << '\n';
}